package com.shawn.integeration.xxljob.worker;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * 测试任务
 *
 * @author: shawn
 * @Date: 2024/1/30 10:43
 * @Version 1.0.0
 */
@Slf4j
@Component
public class TestJob {
    @XxlJob("testJobExecute")
    public void execute() throws InterruptedException {
     log.info("定时任务->执行开始,请求参数:[{}]", XxlJobHelper.getJobParam());

     log.info("定时任务->业务处理中");
     TimeUnit.SECONDS.sleep(1);

     log.info("定时任务->处理结束");
    }
}
